# coding=utf8
# 测试缓存

import random
from app import create_app
from app import cache

application = create_app(flask_config = 'local')


@cache.memoize()
def get(a = None, b = None, c = None):
    return '%s:%s:%s:%s' % (a, b, c, random.random())


if __name__ == '__main__':
    with application.app_context():
        # print  get(a = 1, b = 2, c = 3)
        # print  get(a = 1, b = 2, c = 3)
        # print  get(a = 1, b = 2, c = 4)
        # print  get(a = 1, b = 3, c = 4)
        cache.delete_memoized(get)
        print  get(a = 1, b = 2, c = 3)
        print  get(a = 1, b = 2, c = 3)
        print  get(a = 1, b = 2, c = 4)
        print  get(a = 1, b = 3, c = 4)
        pass
    pass
